#include <iostream>

using namespace std;

template <typename T>
int binsearch(T in[],const int len,const int target){
    int left=0;
    int right=len-1;
    int mid=0;
    while(left<=right){
        mid=(left+right)/2;
        if(in[mid]==target){
            return mid;
        } else if(in[mid]>target){
            right=mid-1;
        } else {
            left=mid;
        }
    }
    return -1;
}

int main(){
    const int len=10;
    const int target=6;
    int a[len]={0,1,2,3,4,5,6,7,8,9};
    int idx=binsearch(a,len,target);
    if(idx>0){
        cout<<"find "<<idx<<endl;
    } else{
        cout<<"not find"<<endl;
    }
    return 0;
}